home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
7_9.lha
/
7_9
/
7_9_getp.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
516b
|
34 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
/ Get the previous entry from a list,
/ removing it afterwards
nt dlist::getprev(dlink *&a)
if (!last)
return 0;
// choose the link to remove
if (curr)
if (curr == last->prev)
{
curr = 0;
return 0;
}
else
a = curr->prev;
else
a = curr = last;
// remove f from the list
if (a == last)
last = 0;
else
a->remove();
return 1;